  use "$data\women_analysis.dta", clear

  global controlwoman mbase_ageyears  fdstotal rantime ranerror numberkids
  global controlhh land members adults mbase_electrified  mbase_OB mbase_scheduled

  estimates clear
  ****Table 5 Panel A
  foreach i in dohome_day dohome_week remind_day remind_week talkteach_day talkteach_week{
  ivregress 2sls `i' (participatedTA_IV=ITTanalysis) i.strata $controlwoman $controlhh if sequence==1, vce(robust)
  est store `i'
  su `i' if sequence==1 & ITTanalysis==0
  estadd scalar controlmean=`r(mean)'
  }

  ****Table 5 Panel B
 foreach i in cover treatwater washhands kidchat consultnurse_day consultnurse_week consultnurse_month consultnurse_6months{
 ivregress 2sls `i' (participatedTA_IV=ITTanalysis) i.strata $controlwoman $controlhh if sequence==1, vce(robust) 
 est store `i'
 su `i' if sequence==1 & ITTanalysis==0
 estadd scalar controlmean=`r(mean)'
 }

 esttab * using "$results\Table5.xls", stat(controlmean N r2) keep (participatedTA_IV) b(3) se(3) replace
 
 ***FDR q-values
 *The FDR Q-values are computed following  Benjamini and Hochberg (1995) within each category.
 
 exit
 

